<div class="page-content">
    <div class="page-header position-relative">
        <h1>Habitaci&oacute;n<small><i class="icon-double-angle-right"></i> Mantenimiento</small></h1>
    </div>
    <div class="row-fluid">
        <div class="span12">
            <div class="widget-box">
                <div class="widget-header"><h4>Formulario Habitaci&oacute;n</h4>
                    <span class="widget-toolbar">
                        <a data-action="collapse" href="#">
                            <i class="icon-chevron-up"></i>
                        </a>
                    </span>
                </div>
                <?php
                if (empty($registros)) {
                    $cod_hab = "";
                    $nro_hab = "";
                    $tip_hab = "";
                    $piso_hab = "";
                    $est_hab = "";
                } else {
                    $cod_hab = $registros[0]->id_habi;
                    $nro_hab = $registros[0]->nro_habi;
                    $tip_hab = $registros[0]->tipo_habi;
                    $piso_hab = $registros[0]->piso;
                    $est_hab = $registros[0]->est_habi;
                }
                ?>
                <script>
                    $(function() {
                        combo("<?php echo base_url("intranet/administrador/combo/tipoHabitacion") ?>", "tiphab");
                        $("#tiphab").val(<?php echo $tip_hab; ?>);
                        $("#piso").val(<?php echo $piso_hab; ?>);
                        $("#est").val(<?php echo $est_hab; ?>);
                    });
                </script>
                <div class="widget-body">
                    <div class="widget-body-inner">
                        <div class="widget-main">
                            <form action="<?php echo base_url("intranet/administrador/registrarModificarHabitacion"); ?>" class="form-horizontal" method='post'>
                                <div class="row-fluid">
                                    <div class="span5">
                                        <div class="control-group">
                                            <label class="control-label" for="nro">Nro Habitaci&oacute;n</label>
                                            <div class="controls">
                                                <input type='hidden' id='cod' name='cod' value="<?php echo $cod_hab; ?>" >
                                                <input type='text' id='nro' name='nro' value="<?php echo $nro_hab; ?>" required='required' class="span12">
                                            </div>                                            
                                        </div>
                                        <div class="control-group">
                                            <label class="control-label" for="piso">Piso</label>
                                            <div class="controls">
                                                <select id='piso' name='piso' class=''>
                                                    <option value='1'>Primero</option>
                                                    <option value='2'>Segundo</option>
                                                    <option value='3'>Tercero</option>
                                                </select>
                                            </div>                                            
                                        </div>
                                    </div>
                                    <div class="span5">
                                        <div class="control-group">
                                            <label class="control-label" for="tiphab">Tipo de Habitaci&oacute;n</label>
                                            <div class="controls">
                                                <select id="tiphab" name="tiphab"></select>
                                            </div>                                            
                                        </div>
                                        <div class="control-group">
                                            <label class="control-label" for="est">Tipo de Habitaci&oacute;n</label>
                                            <div class="controls">
                                                <select id="est" name="est">
                                                    <option value="0">No Disponible</option>
                                                    <option value="1">Disponible</option>
                                                </select>
                                            </div>                                            
                                        </div>
                                    </div>
                                </div>
                                <div class="form-actions">
                                    <button type='submit' class='btn btn-primary'><i class="icon-save"></i> Guardar</button>                    
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>